#include "drve_led.h"
#include "drv_beep.h"
#include "drv_systick.h"
#include "drv_key.h"
#include "drv_exit.h"
#include "drv_usart.h"
#include "drv_time.h"
#include "drv_sht20.h"
#include "drv_seg.h"
#include "drv_dma.h"
#include "drv_adc.h"
#include "FreeRTOS.h"
#include "task.h"
#include "drv_duo.h"
#include "drv_motor.h"
#include "drv_yuyin.h"
#include "drv_wifi.h"
#include  "string.h"
#include "drv_iic.h"
 #include "oled.h"
#include "yoled.h"
//static uint8_t key_status=0;
////dma的源数据
#define max 128  //接收缓冲区最大长度
uint8_t data_len=0;//接收数据长度
uint8_t data_buf[max]={0} ;//接收数据缓冲区

uint32_t dma_src[10]={0x11111111,0x11111112,0x11111113,0x11111114,0x11111115,
					  0x11111116,0x11111117,0x11111118,0x11111119,0x11111110
					  };

uint32_t dma_drc[10];	 				  
#define max 128  //接收缓冲区最大长度
uint8_t data_len;//接收数据长度
uint8_t data_buf[max] ;//接收数据缓冲区
uint8_t data_ready ;//数据接收完成标志

#define CMD_BUF_LEN 32 // 命令缓冲区长度
					  


int main(void)
{
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//中断组
	drv_systick_init(168);
//	BaseType_t ret ;
	drve_led_int1();
	drve_led_int2();
	drve_led_int3();
	drv_time3_init();

	drv_usart6_init();

	usart2_init();


	drv_sht20_init();

	drv_sht20_rest();
	drv_74hc595_init();


	TIM1_INIT();
	 motor_init();



//wifi模块
	#if 0
	drv_usart3_init();
    current_state = STATE_IDLE;
	action_step = 0;
	action_counter = 0;
	action_repeat_count = 0;
	drv_wifi_init();
	while(1)
	{
			if(usart3_ready)
			{
				wifi_command();
			}
			update_dog_action();
			drv_systick_ms(10);
	
		}
	}
#endif

//语音模块
#if 1
	current_state = STATE_IDLE;
	action_step = 0;
	action_counter = 0;
	action_repeat_count = 0;
	
	while(1)
	{

			update_dog_action();
			drv_systick_ms(10);
	
		}
	}
#endif

	

